// 下载路由
// 导入路由
import{createRouter,createWebHashHistory}from'vue-router'
// 实例化路由对象并将router实例对象暴露出去
export default createRouter({
    history:createWebHashHistory(),
    routes:[
        // login
        {path:'/test',component:()=>import('@/views/test/index.vue')},
        // layout页面
        {
            path:'/',
            redirect:'/home',
            component:()=>import('@/views/layout/index.vue'),
            children:[
                {path:'home',component:()=>import('@/views/home/index.vue')},
                {path:'category/:id',component:()=>import('@/views/category/index.vue')},
                {path:'category/sub/:id',component:()=>import('@/views/category/sub.vue')}
            ]
    }
    ]
})